#include<iostream>
#include<string>
using namespace std;
int main(){
	string a,b;
	cin>>a>>b;
	double sum=a.size();
	double count=0;
	for(int j=0;j<sum;j++){
		if(a[j]!=b[j]){
			count++;
		}
	}
	double d=(sum-count)/sum;
	printf("%.2f",d);
}
